package com.example.demo.controller;

import com.example.demo.ResultVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Description:
 * @Author: WD created on 2021-09-14 20:31
 * @Version:
 */

@Controller
@RequestMapping("hello")
public class MyController {


    @RequestMapping("world")
    public void hello(HttpServletResponse response) throws IOException, InterruptedException {
        response.setHeader("refresh", "3");
        response.sendRedirect("http://www.baidu.com");

    }

    @ResponseBody
    @RequestMapping("boy")
    public ResultVo boy(HttpServletResponse response){
        return ResultVo.ok();
    }

}
